package com.shensi.appCollect.service.impl;

import com.shensi.appCollect.dao.StationEnterpriseCopInfoMapper;
import com.shensi.appCollect.pojo.vo.StationEnterpriseCopInfoVo;
import com.shensi.appCollect.service.StationEnterpriseCopInfoService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Objects;

@Service
public class StationEnterpriseCopInfoServiceImpl implements StationEnterpriseCopInfoService {

    @Resource
    private StationEnterpriseCopInfoMapper stationEnterpriseCopInfoMapper;
    @Override
    public String getOrgCode(StationEnterpriseCopInfoVo stationEnterpriseCopInfoVo) {
        StationEnterpriseCopInfoVo stationEnterpriseCopInfoVoRes = stationEnterpriseCopInfoMapper.getStationEnterpriseCopInfoVo(stationEnterpriseCopInfoVo);
        String copId = Objects.nonNull(stationEnterpriseCopInfoVoRes) ? stationEnterpriseCopInfoVoRes.getCopId() : "";
        return StringUtils.isNotBlank(copId) ? copId.replace("SC","") : "";
    }
}
